package ru.susu.algebra.jtex;

import java.util.List;

import com.google.common.collect.Lists;

import ru.susu.algebra.jtex.utils.TexUtils;

/**
 * @author akargapolov
 * @since: 16.08.2010
 */
public abstract class TexElementBase implements ITexSubItemsElement
{
	private List<ITexElement> _elements = Lists.newArrayList();

	@Override
	public ITexSubItemsElement addSubElement(ITexElement subElement)
	{
		if (subElement != null)
			_elements.add(subElement);
		return this;
	}

	public String generateSubItemsContent()
	{
		return TexUtils.processElements(_elements);
	}

}
